/**
* \file
* \author Adam Martin
* \date 2011-10-23
* \brief The main entry point for the OpenGL Module. Also defines the OpenGL Module interface class.
*/
#pragma once

// System Library Includes

// Application Library Includes

// Local Includes
#include "ModuleInterface.h"

// Forward Declarations
class EventLogger;
namespace irr {
	class IrrlichtDevice;
	namespace scene {
		class ISceneManager;
	}
	namespace video {
		class IVideoDriver;
	}
}

// Typedefs
extern "C"
{
	__declspec(dllexport) ModuleInterface* ModuleFactory(EventLogger*);
}

class IrrlichtModule : public ModuleInterface {
public:
	IrrlichtModule(EventLogger* log);
	~IrrlichtModule() { }

	/**
	* \brief Register Irrlicht in Angelscript
	*/
	void Register(asIScriptEngine* const);

	/**
	* \brief Called each game update.
	* \param[in] dt Change in time in milliseconds since last update.
	*/
	void Update(double dt);

	WHO_DELETES::TYPE RemoveComponent(ComponentInterface* comp) {
		return WHO_DELETES::CALLEE;
	}

	/**
	* \brief Creates the Irrlicht device and stores a pointer to the SceneManager and VideoDriver.
	*/
	bool StartDevice(int, int, std::string = "");
private:
	EventLogger* elog;

	// Render variables
	static irr::IrrlichtDevice *device;
	irr::scene::ISceneManager* smgr;
	irr::video::IVideoDriver* driver;
};